#include <vector>
#include <iostream>
using namespace std;

void arrayConstruction(const vector<int> &org,vector<int> &tar)
{
	int length1 = org.size();
	int length2 = tar.size();

	if(length1==length2 && length1>0)
	{
		int i = 0;

		tar[i] = 1;
		for(i = 1;i != length1;++i)
			tar[i] = tar[i-1] * org[i-1];

		int temp = 1;
		for(i = length1-2; i >= 0 ; --i)
		{
			temp *= org[i+1];
			tar[i] *= temp;
		}
	}
}

int main()
{
	vector<int> v1{4,6,3,2,7,8,4},v2(7,0);
	arrayConstruction(v1,v2);
	for(int i : v1)
		cout<<i<<',';
	cout<<endl;
	for(int i : v2)
		cout<<i<<',';
	cout<<endl;
	return 0;
}